<?php
require_once '../../includes/global.php';

$sortinfo=Dga('infosort'," id = '".$_POST[sortid]."'");
if($sortinfo['tname']==''){
$sortinfo['tname']='info';
}
$info=Dga($sortinfo['tname'],"id='".$_POST[id]."'");
//Jc($info);

if($info[shuser]!=$_SESSION[userinfo][user]){
Ja('非正常访问');
exit;
}
$ar[shuser]=$info[shuser];

if($_POST[status]=='1'){
$ar['shstatus']=1;
$ar[shuser]='';
}
if($ar[shuser]!=''){
	if(Sf(',',$info['shno'])){
	$ar['shuser']=substr($info['shno'],0,strpos($info['shno'],','));
	$ar['shno']=substr($info['shno'],strpos($info['shno'],',')+1);}
	else{
	$ar['shuser']=$info['shno'];
	$ar['shno']='';
	}
}
$ar[id]=$_POST[id];
$sts=array('0'=>'审核中。。','1'=>'未通过','2'=>'通过');
$ar['shinfo']=$info['shinfo']."<br>".$_SESSION[userinfo][user]."于".date("Y-m-d H:i:s")."审核".$sts[$_POST[status]]."<br>批语".html_entity_decode(stripslashes($_POST['shinfo']));

if($ar['shstatus']!=1&&$ar['shuser']==''){
$ar['shstatus']=2;
}
//Jc($ar);
Du($sortinfo[tname],$ar,'id',$_POST[id]);
Jt($_SERVER['HTTP_REFERER'],'审核成功');
	
	
?>